<?php
function connexion ()
{
$machine="localhost";
$user="root";
$password="";
$database="projetd";
$connexion= mysqli_connect ($machine,$user,$password,$database);
if(mysqli_connect_errno())// erreur si > 0
printf("Échec de la connexion :%s", mysqli_connect_error());
return $connexion;}

function requete($requete, $connexion)
{	
	$var_tab=[];
	$res= mysqli_query($connexion,$requete);
	while ($ligne=mysqli_fetch_assoc($res))
	{
	array_push($var_tab, $ligne);
	}
	return $var_tab;
}

?>